﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using chatGUI.Model;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using System.Collections.ObjectModel;
using System.Windows.Input;
using HandyControl.Data;
using chatGUI.DataBase.Dao;
using chatGUI.SingeltonData;
using chatGUI.DataBase.Entity;
using GalaSoft.MvvmLight.Messaging;
using messageData;
using HandyControl.Controls;
using System.Windows;

namespace chatGUI.ViewModel
{
    public class findFriendAndGroupViewModel : ViewModelBase
    {
        public findFriendAndGroupViewModel()
        {
            IsSearchFriend = true;
            Cards = new ObservableCollection<friendAndGroupCardModel>();
        }
        private ObservableCollection<friendAndGroupCardModel> cards;
        public ObservableCollection<friendAndGroupCardModel> Cards
        {
            get => cards;
            set => Set(ref cards, value);
        }
        private bool isSearchFriend;
        public bool IsSearchFriend
        {
            get => isSearchFriend;
            set => Set(ref isSearchFriend, value);
        }
        private bool flag = true;
        public RelayCommand<SearchBar> searchFriendAndGroupCmd => new Lazy<RelayCommand<SearchBar>>(() =>
            new RelayCommand<SearchBar>(searchInfo)).Value;
        private void searchInfo(SearchBar key)
        {
        }
        private List<User> tempUser = new List<User>();
        private void findFriendById(User user)
        {
        }
        private void findFriendLikeName(List<User> users)
        {
        }
        private List<messageData.Group> tempGroup = new List<messageData.Group>();
        private void findGroupByID(messageData.Group group)
        {
        }
        private void findGroupLikeName(List<messageData.Group> groups)
        {
        }
        public RelayCommand<string> addFriendCmd => new Lazy<RelayCommand<string>>(() =>
            new RelayCommand<string>(addFriend)).Value;
        private void addFriend(string id)
        {
        }
        public RelayCommand<RoutedEventArgs> createGroupCmd => new Lazy<RelayCommand<RoutedEventArgs>>(() =>
            new RelayCommand<RoutedEventArgs>(createGroup)).Value;
        private string groupName;
        public string GroupName
        {
            get => groupName;
            set => Set(ref groupName, value);
        }
        private void createGroup(RoutedEventArgs e)
        {
        }
        private void initDataBaseGroups(List<messageData.Group> groups)
        {
        }
    }
}
